<!DOCTYPE html>
<html lang="en">
<head>
    %{--<meta name="layout" content="bocMain"/>--}%
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta content="black" name="apple-mobile-web-app-status-bar-style">
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta content="telephone=no" name="format-detection">
    <meta content="email=no" name="format-detection"/>
    <asset:stylesheet src="boc/weui.min.css"/>
    <asset:stylesheet src="boc/jquery-weui.min.css"/>
    <asset:stylesheet src="boc/boc.css"/>
    <asset:javascript src="boc/jquery.min.js"/>
    <title>进件作业系统</title>
</head>

<body>
<div class="opportinityList" style="padding-top: .5rem !important;">
    <div class="weui-cells">
        <div class="weui-cell">
            <div class="weui-cell__bd">
                <p>订单（进件）编号：<span>${opportunity?.serialNumber}</span></p>
            </div>

            <div class="weui-cell__ft stage">待审批</div>
        </div>

        <div class="weui-cell">
            <div class="weui-cell__bd">
                <p>客户：${opportunity?.contact?.fullName}</p>
            </div>

            <div class="weui-cell__ft">客户手机：${opportunity?.contact?.cellphone}</div>
        </div>

        <div class="weui-cell">
            <div class="weui-cell__bd">
                <p>申请金额：${opportunity?.requestedAmount}</p>
            </div>

            <div class="weui-cell__ft">借款期限：${opportunity?.loanDuration}月</div>
        </div>

        <div class="weui-cell last-item">
            <div class="weui-cell__bd">
                <p>产品：${opportunity?.product?.name}</p>
            </div>

            <div class="weui-cell__ft">${opportunity?.importDate}</div>
        </div>
    </div>

    <div class="weui-cells">
        <div class="weui-cells__title">经销商信息</div>

        <div class="weui-cell">

            <div class="weui-cell__bd">
                <p>商户：${opportunity?.account?.name}</p>
            </div>
        </div>

        <div class="weui-cell">
            <div class="weui-cell__bd">
                <p>渠道：${opportunity?.account?.parent?.name}</p>
            </div>
        </div>
    </div>

    <div class="weui-cells">
        <div class="hide" id="stage">07</div>
        <div class="hide" id="status">${this.opportunity?.status}</div>
        <div class="weui-cells__title">业务流程状态</div>
        <div class="bgcWhite workflow">
            <ul class="flowList">
                <g:if test="${curerentStageStatus == 'Completed'}">
                    <g:each in="${workflowInstanceStageList}">
                        <li class="flowItem active">
                            <span class="icon"></span>
                            <h3>已完成<label style="font-size: 1rem">  <g:formatDate format="yyyy-MM-dd HH:mm:ss"
                                                                                  date="${it?.endTime}"/></label></h3>
                            <h4>${it?.name}</h4>
                        </li>
                    </g:each>
                </g:if>
                <g:if test="${curerentStageStatus == 'Pending'}">
                    <g:each in="${workflowInstanceStageList}">
                        <g:if test="${it?.executionSequence<curerentStageNumber}">
                            <li class="flowItem active">
                                <span class="icon"></span>
                                <h3>已完成 <label style="font-size: 1rem">
                                    <g:formatDate format="yyyy-MM-dd HH:mm:ss"
                                                  date="${it?.endTime}"/>
                                    </label></h3>
                                <h4>${it?.name}</h4>
                            </li>
                        </g:if>
                        <g:if test="${it?.executionSequence>curerentStageNumber}">
                            <li class="flowItem">
                                <span class="icon"></span>
                                <h3>未完成</h3>
                                <h4>${it?.name}</h4>
                            </li>
                        </g:if>
                        <g:if test="${it?.executionSequence==curerentStageNumber}">
                            <li class="flowItem goActive">
                                <span class="icon"></span>
                                <h3>正在进行</h3>
                                <h4>${it?.name}</h4>
                            </li>
                        </g:if>
                    </g:each>
                </g:if>
                <g:if test="${curerentStageStatus == 'Failed'}">
                    <g:each in="${workflowInstanceStageList}">
                        <g:if test="${it?.executionSequence<curerentStageNumber}">
                            <li class="flowItem active">
                                <span class="icon"></span>
                                <h3>已完成</h3>
                                <h4>${it?.name}</h4>
                            </li>
                        </g:if>
                        <g:if test="${it?.executionSequence>curerentStageNumber}">
                            <li class="flowItem">
                                <span class="icon"></span>
                                <h3>未完成</h3>
                                <h4>${it?.name}</h4>
                            </li>
                        </g:if>
                        <g:if test="${it?.executionSequence==curerentStageNumber}">
                            <li class="flowItem activeError">
                                <span class="icon"></span>
                                <h3>已失败</h3>
                                <h4>${it?.name}</h4>
                            </li>
                        </g:if>
                    </g:each>
                </g:if>
            </ul>
        </div>
    </div>
</div>

<div class="bigBtn">
    <g:if test="${curerentStageStatus != 'Completed'}">
        <a href="/bocAppOpportunity/reSubmit/${opportunity?.id}" class="weui-btn weui-btn_primary">继续下一步</a>
    </g:if>
    <a href="/bocAppOpportunity/businessManagement" class="weui-btn weui-btn_primary">订单列表</a>
</div>
<script>

    $(function ()
    {
        var message = '${flash.message}';
        if (message) {
            $(".helpMsg").text(message).fadeIn(200);
            setTimeout(function () {
                $(".helpMsg").fadeOut(200);
            }, 2000);
        }
    });
</script>

</body>
</html>
